<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateShopLicenseRecords extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_shop_license_records', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('shopId')->default(0)->comment('门店ID');

            $table->unsignedInteger('status')->default(0)->comment('审核状态:0-证件缺失,1-待审核,2-审核通过,3-已驳回,4-过期');

            $table->unsignedInteger('merchantUpdatedAtByUid')->default(0)->comment('商家修改人');
            $table->unsignedInteger('merchantUpdatedAt')->default(0)->comment('商家修改时间');

            $table->unsignedInteger('cruiseAt')->default(0)->comment('稽核时间');
            $table->unsignedInteger('cruiseAtByUid')->default(0)->comment('稽核人员');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->tinyInteger("isDeleted")->default(0)->comment("是否删除,0:未删除,1:已删除");

            $table->index('shopId', 'idx_shopId');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '门店资质审核状态表';

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_license_records');
    }
}
